// 引入react
import * as React from 'react';
import {StyleSheet,View,Text,Dimensions,TouchableWithoutFeedback,TouchableOpacity,TouchableHighlight} from 'react-native';
import Icon from 'react-native-vector-icons/AntDesign';

/**
 * @Description:
 * @author TangYong
 * @date 2022/12/15
 */
export class HeaderTitle extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
        };
    }
    //生命周期：组件挂载后
    componentDidMount() {

    }

    //方法

    back=()=>{
        this.props.goBack()
    }

    //DOM
    render() {
        return (
            <View style={style.con_top}>
                <View style={style.fa}>
                    <TouchableWithoutFeedback  onPress={this.back} >
                        <View >
                            <Icon style={style.icon}  name='left' size={20}></Icon>
                        </View>
                    </TouchableWithoutFeedback>

                    <Text style={style.title}>{this.props.headtitle}</Text>
                    <Text style={style.kong}>1</Text>
                </View>
            </View>
        )
    }

}
const width=Dimensions.get('window').width;
const style = StyleSheet.create({
    //样式
    con_top: {
        backgroundColor: '#fff',
        borderBottomWidth: 1,
        borderStyle: 'solid',
        borderColor: '#E8E8EA',
        width: width,
        //padding: '3%',
        paddingTop:'3%',
        paddingBottom:'3%',
        //paddingLeft:"3%",
        flexDirection: 'row',
    },
    fa:{
        //backgroundColor:"red",
        flexDirection: 'row',
        width:"100%",
        //backgroundColor:"red",
        justifyContent:"space-between",
        alignItems: "center",
    },
    icon:{
        paddingLeft:15
    },
    title:{
        fontWeight:'bold',
        fontSize:17
    },
    kong:{
        width:35,
        color:"#fff"
    }
})
